package com.aimei.message.config;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.config.JmsListenerContainerFactory;
import org.springframework.jms.config.SimpleJmsListenerContainerFactory;
import org.springframework.stereotype.Component;

import javax.jms.ConnectionFactory;

/**
 * @author xiah
 * @date 2018/5/15 10:24
 */
@Configuration
@Component
public class MycontainerFactory {
       @Bean(name = "wqe")
       public JmsListenerContainerFactory getJmsListenerContainerFactory(ConnectionFactory connectionFactory){
              SimpleJmsListenerContainerFactory simpleJmsListenerContainerFactory=new
                      SimpleJmsListenerContainerFactory();
              simpleJmsListenerContainerFactory.setConnectionFactory(connectionFactory);
              simpleJmsListenerContainerFactory.setPubSubDomain(true);
              return  simpleJmsListenerContainerFactory;
       }
}
